﻿Imports System.ServiceModel
Namespace ServiceContract
    <ServiceContract(Namespace:="PowerShellCron.Service", Name:="IManageSvc")>
    Public Interface IManageSvc
#Region "Jobs"
        <OperationContract()>
        Function GetJobs(name As String, category As String, tags As String()) As ICollection(Of DataContract.Job)
        <OperationContract()>
        Function GetJob(jobId As Integer) As DataContract.Job
        <OperationContract()>
        Sub SetJob(job As DataContract.Job) 'add/update
        <OperationContract()>
        Sub RemoveJob(jobId As Integer)
        <OperationContract()>
        Sub ExecuteJob(jobId As Integer)
        <OperationContract(Name:="ExecuteJobByName")>
        Sub ExecuteJob(name As String)
#End Region
#Region "Scripts"
        <OperationContract()>
        Function GetScripts(name As String, category As String, tags As String()) As ICollection(Of DataContract.Script)
        <OperationContract()>
        Function GetScript(scriptId As Integer) As DataContract.Script
        <OperationContract()>
        Sub SetScript(script As DataContract.Script) 'add/update
        <OperationContract()>
        Sub RemoveScript(scriptId As Integer)
        <OperationContract()>
        Sub ExecuteScript(scriptId As Integer)
        <OperationContract(Name:="ExecuteScriptByName")>
        Sub ExecuteScript(name As String)
#End Region
#Region "Security"
        <OperationContract()>
        Function GetSecurityUsers() As ICollection(Of DataContract.SecurityUser)
        <OperationContract()>
        Function GetSecurityUser(name As String) As DataContract.SecurityUser
        <OperationContract()>
        Sub SetSecurityUser(data As DataContract.SecurityUser)
        <OperationContract()>
        Sub RemoveSecurityUser(securityUserId As Integer)
        '<OperationContract()>
        'Sub AddSecurityRolesToSecurityUser()
#End Region
#Region "Categorization"

#End Region
#Region "Platform"
        <OperationContract()>
        Function Ping() As String
        <OperationContract()>
        Function GetTasks() As ICollection(Of DataContract.CronTask)
        <OperationContract()>
        Function GetTask(guid As Guid) As DataContract.CronTask
        <OperationContract()>
        Sub CancelTask(cronGuid As Guid)
        <OperationContract()>
        Sub CancelAllTasks()
        <OperationContract()>
        Sub EnableTasks()
        <OperationContract()>
        Sub DisableTasks()
        <OperationContract()>
        Function TasksAllowed() As Boolean
#End Region
    End Interface
End Namespace
